<el-dialog id="flowForm" title="流转" :visible.sync="dialogVisible" :width="dialogWidth" top="100px" v-dialog-drag
           :fullscreen="fullscreen" :close-on-click-modal="false" v-cloak>
	<div class="my-dialog-body">
		<el-form ref="form" :model="form" :rules="rules" label-width="120px" size="mini" :disabled="disabled">
			<el-row>
				<el-col :xs="24" :sm="12" :lg="24">
					<el-form-item label="接手人" prop="userId">
						<my-select v-model="form.userId" res="user" :search-data="searchData"></my-select>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :xs="24" :sm="12" :lg="24">
					<el-form-item label="流转原因" prop="reason">
						<el-input type="textarea" v-model="form.reason"></el-input>
					</el-form-item>
				</el-col>
			</el-row>
		</el-form>
	</div>

	<div slot="footer">
		<el-button type="warning" icon="el-icon-s-custom" @click="save(true)"
		           :loading="saveDisabled">流 转
		</el-button>
		<el-button icon="el-icon-close" @click="dialogVisible = false">取 消</el-button>
	</div>
</el-dialog>

<script>
	var flowFormVue = new SaveDataVue({
		el: "#flowForm",
		data: function () {
			return {
				searchData: {unQuery: true},
				form: {
					taskId: null,
					userId: null,
					reason: null
				},
				rules: {
					userId: {"required": true, "message": "接手人必须填写"},
					reason: {"required": true, "message": "流转原因必须填写"}
				},
			};
		},
		methods: {
			init({taskId, option}) {
				this.form.taskId = taskId;
				this.saveUrl = my.base + '/' + option.url;
				this.searchData = myUtil.copyObj(option.searchData);
			}
		}
	});
</script>
